@extends("layouts.backend.webadmin")


<link rel="stylesheet" href="{{env('APP_ROOT')}}/assets/layui/css/layui.css">
<script src="{{env('APP_ROOT')}}/assets/layui/layui.js"></script>

@section('content')

    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <div class="box">
                    <div class="box-body">

                            <form method="POST" action="{{ URL::route('admin.flaw.confirmForm') }}">

                                <div class="form-group">
                                    <label for="vulsCategoryId">漏洞编号</label><br>
                                    @foreach ($vuls as $lists)
                                        <blockquote id="vulsCategoryId" class="layui-elem-quote layui-quote-nm">
                                            {{$lists->vuls_number}}
                                        </blockquote>
                                    @endforeach
                                </div>
                                @needsroles([2,3])
                                <div class="form-group">
                                    <label for="vulsCategoryId">标题</label><br>
                                    @foreach ($vuls as $lists)
                                        <blockquote id="vulsCategoryId" class="layui-elem-quote layui-quote-nm">
                                            {{$lists->title}}
                                        </blockquote>
                                    @endforeach
                                </div>
                                @endauth
                                <div class="form-group">
                                    <label for="vulsCategoryId">副标题</label><br>
                                    @foreach ($vuls as $lists)
                                        <blockquote class="layui-elem-quote layui-quote-nm" id="vulsCategoryId">
                                            {{$lists->description}}
                                        </blockquote>
                                    @endforeach
                                </div>
                                <div class="form-group">
                                    <label for="vulsCategoryId">漏洞URL</label><br>
                                    @foreach ($vuls as $lists)
                                        <blockquote id="vulsCategoryId" class="layui-elem-quote layui-quote-nm">
                                            {{$lists->form_url}}
                                        </blockquote>
                                    @endforeach
                                </div>
                                <div class="form-group">
                                    <label for="vulsCategoryId">URL参数</label><br>
                                    @foreach ($vuls as $lists)
                                        <blockquote id="vulsCategoryId" class="layui-elem-quote layui-quote-nm">
                                            {{$lists->url_parms}}
                                        </blockquote>
                                    @endforeach
                                </div>
                                <div class="form-group">
                                    <label for="vulsCategoryId">Payload</label><br>
                                    @foreach ($vuls as $lists)
                                        <blockquote id="vulsCategoryId" class="layui-elem-quote layui-quote-nm">
                                            {{$lists->payload}}
                                        </blockquote>
                                    @endforeach
                                </div>
                                <div class="form-group">
                                    <label for="vulsCategoryId">漏洞详情</label><br>
                                    <blockquote class="layui-elem-quote layui-quote-nm" id="vulsCategoryId">
                                        {!!$vuls[0]->content  !!}
                                    </blockquote>
                                </div>
                                <div class="form-group">
                                    <label for="vulsCategoryId">参考资料</label><br>
                                    @foreach($vuls[0]->ref as $ref)
                                        <div class="col-md-12">
                                            <a style="padding-left:15px;" target="_blank" href="{{route('knowledge.showpage',['id'=>$ref->id])}}">{{mb_substr($ref->title,0,50)}}</a>
                                        </div>
                                    @endforeach
                                </div>
                                <div class="form-group">
                                    <label>描述</label>
                                    <textarea class="form-control" maxlength="255" required rows="3" placeholder="相关描述..."
                                              name="description"></textarea>
                                </div>
                                <div class="form-group">
                                    {{csrf_field()}}
                                    <input type="hidden" name="id" value="{{$id}}">
                                    <button class="layui-btn" name="confirm" value="allocations" lay-submit
                                            lay-filter="formDemo">确认已修复
                                    </button>
                                    <button type="submit" name="Reconfirmation" value="Reconfirmation"
                                            class="layui-btn layui-btn-primary">未修复
                                    </button>
                                </div>

                            @if($record)
                                <div class="form-group">
                                    <label for="vulsCategoryId">修复过程</label>
                                    <blockquote class="layui-elem-quote layui-quote-nm">
                                        <ul class="layui-timeline">
                                            @foreach($record as $records)
                                                <li class="layui-timeline-item">
                                                    <i class="layui-icon layui-timeline-axis">&#xe63f;</i>
                                                    <div class="layui-timeline-content layui-text">
                                                        <h3 class="layui-timeline-title">
                                                            @if($records->created_at)
                                                                {{$records->created_at}}
                                                            @endif
                                                        </h3>
                                                        <ul>
                                                            @if($records->vuls_status)
                                                                <li>
                                                                    状态：{{$status[$records->vuls_status]['name']}}
                                                                </li>
                                                            @endif
                                                                @if($records->creatname)
                                                                    <li>
                                                                        创建者：{{$records->creatname}}({{$records->creal_name}})({{$records->phone}})
                                                                    </li>
                                                                @endif


                                                                @if($records->updatename)
                                                                    <li>
                                                                        更新者：{{$records->updatename}}({{$records->ureal_name}})({{$records->phone}})
                                                                    </li>
                                                                @endif
                                                                @if($records->reward)
                                                                    <li>
                                                                        当前金币：{{$records->reward}}
                                                                    </li>
                                                                @endif
                                                                @if($records->credit)
                                                                    <li>
                                                                        当前积分：{{$records->credit}}
                                                                    </li>
                                                                @endif
                                                            @if($records->content)
                                                                <li>
                                                                    说明：{{$records->content}}
                                                                </li>
                                                            @endif

                                                        </ul>
                                                    </div>
                                                </li>
                                            @endforeach
                                        </ul>
                                    </blockquote>
                                </div>
                                @endif

                            </form>
                        <input type="hidden" id="error" value="@foreach ($errors->all() as $error){{ $error }}@endforeach">
                        @if(count($errors->all()))
                            <script type="text/javascript">
                                var message=$("#error").val();
                                layui.use('layer', function(){
                                    var layer = layui.layer;
                                    layer.open({
                                        title: '错误提示'
                                        ,content: message
                                    });
                                });
                            </script>

                        @endif
                        <input type="hidden" id="errors" value="{{session('flow_error')}}">
                        @if(session('flow_error'))
                            <script type="text/javascript">
                                var message=$("#errors").val();
                                layui.use('layer', function(){
                                    var layer = layui.layer;
                                    layer.open({
                                        title: '错误提示'
                                        ,content: message
                                    });
                                });
                            </script>

                        @endif
                    </div>
                </div>
            </div>
        </div>
    </section>

@stop